package top.gokzzz.mock.service;

import top.gokzzz.common.utils.CollUtil;
import top.gokzzz.mock.entity.Department;
import top.gokzzz.mock.entity.Position;
import top.gokzzz.mock.entity.Staff;

import java.time.LocalDate;
import java.util.List;
import java.util.UUID;

public class MockService {
    public static Department getDepartment() {
        Department department = new Department();
        department.setId(UUID.randomUUID().toString());
        department.setCode("D001");
        department.setName("後端部門");
        department.setOrder(1);
        return department;
    }

    public static List<Position> getPosition() {
        Position position = new Position();
        position.setId(UUID.randomUUID().toString());
        position.setCode("P001");
        position.setName("後端");
        position.setOrder(1);
        Position position2 = new Position();
        position2.setId(UUID.randomUUID().toString());
        position2.setCode("P002");
        position2.setName("運維");
        position2.setOrder(2);
        return CollUtil.newList(position, position2);
    }

    public static Staff getStaff() {
        Staff staff = new Staff();
        staff.setId(UUID.randomUUID().toString());
        staff.setCode("S000000001");
        staff.setGender(Staff.Gender.MALE);
        staff.setName("小明");
        staff.setEmail("123@test.com");
        staff.setMobile("123123123");
        staff.setAddress("廣東省珠海市");
        staff.setBirthday(LocalDate.now());
        staff.setDepartment(getDepartment());
        staff.setPositions(getPosition());
        return staff;
    }

    public static List<Staff> getStaffList() {
        Staff staff = new Staff();
        staff.setId(UUID.randomUUID().toString());
        staff.setCode("S000000001");
        staff.setGender(Staff.Gender.MALE);
        staff.setName("小明");
        staff.setEmail("123@test.com");
        staff.setMobile("123123123");
        staff.setAddress("廣東省珠海市");
        staff.setBirthday(LocalDate.now());
        staff.setDepartment(getDepartment());
        staff.setPositions(getPosition());

        Staff staff2 = new Staff();
        staff2.setId(UUID.randomUUID().toString());
        staff2.setCode("S000000002");
        staff2.setGender(Staff.Gender.MALE);
        staff2.setName("小美");
        staff2.setEmail("321@test.com");
        staff2.setMobile("321321");
        staff2.setAddress("廣東省珠海市");
        staff2.setBirthday(LocalDate.now());
        staff2.setDepartment(getDepartment());
        staff2.setPositions(getPosition());
        return CollUtil.newList(staff, staff2);
    }
}
